/*
 * @Author: wei_jt@ecidi.com
 * @Date: 2021-12-23 09:23:57
 * @LastEditors: wei_jt@ecidi.com
 * @LastEditTime: 2021-12-26 14:04:33
 * @Description:权限定位
 */

import { dataPermission } from "@/permission"


export default function (value) {
  return (target, name, descriptor) => {
    const oldValue = descriptor.value
    descriptor.value = function A (...args) {
      try {
        dataPermission(value)
        oldValue.apply(this, args)
      } catch (err) {
        console.error(err)
      }
    }
    return descriptor
  }
}